package com.bsfcs.rag.repository;

import com.bsfcs.rag.entity.Invoice;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public interface InvoiceRepository extends JpaRepository<Invoice, String>  {
    @Query("SELECT i FROM Invoice i WHERE i.contr_id IN :contrIds")
    List<Invoice> findByContractIdsGrouped(@Param("contrIds") List<String> contr_ids);
}
